import minRequest from '@/config/minRequest.js'
const url = '/customer'
/**
 * 领取纪录列表
 */
export const receiveList = (data) => minRequest.get(url + '/mall/coupon/receiveList', data)

/**
 * 获取验证码
 */
export const sendMsm = (mobile) => minRequest.get(url + `/mall/coupon/sendMsg/${mobile}`)

/**
 * 校验领取数量
 */
export const checkCouponNum = (orderNum, wantNum) => minRequest.get(url + `/mall/coupon/checkCouponIsHave/${orderNum}/${wantNum}`)
/**
 * 点击领取1.0.3
 */
export const selfReceive = (data) => minRequest.post(url + `/v103/order/receive`, data)

/**
 * 点击领取1.0.6
 */
// export const receive = (data) => minRequest.post(`/mall/coupon/receiveNew`,data)
// export const receive = (data) => minRequest.post(url + `/mall/coupon/receiveByOrderNum`, data)
export const receive = (data) => minRequest.post(url + `/mall/coupon/receiveByOrderNumNoCoupon`, data)


/**
 * 填写检测人点击提交
 */
export const testing = (data) => minRequest.post(url + `/mall/coupon/testing`, data)

/**
 * 填写收货人点击提交1.0.6
 */
// export const consignee = (data) => minRequest.post(url + `/mall/coupon/consignee`, data)
export const consignee = (data) => minRequest.post(url + `/mall/coupon/consigneeOnce`, data)


/**
 * 获取领取记录详情
 */
// export const getRocordId = (id) => minRequest.get(url + `/mall/coupon/receiveDetail/${id}`)
export const getRocordId = (id) => minRequest.get(url + `/mall/coupon/receiveDetailCanSeeOther/${id}`)

/**
 * 获取领取记录信息
 */
export const getCouponNum = (couponNum) => minRequest.get(url + `/mall/coupon/detail/${couponNum}`)
export const getCouponNumDetail = (orderNum) => minRequest.get(url + `/v103/order/getByOrderNumSalesman/${orderNum}`)
export const getCheckCouponIsHave = (orderNum) => minRequest.get(url + `/mall/coupon/checkCouponIsHave/${orderNum}`)

/**
 * 回寄成功
 */
export const sendSample = (data) => minRequest.put(url + `/mall/coupon/sendSample`, data)

/**
 * 获得热线电话
 */
// export const getphone = (configKey) => minRequest.get(`/open/config/configKey/${configKey}`)
export const getphone = (protocolCode) => minRequest.get(url + `/open/protocol/getProtocolByCode/${protocolCode}`)

// 根据订单ID判断该订单是否已经签到过 V-1.0.5
export const couponIsHave = (orderNum) => minRequest.get(url + `/mall/coupon/checkCouponIsHaveSignIn/${orderNum}`)